import {addItemData} from "./handleLocal";
import {randomId} from "./common";

export const todoListSchema = {
    title:'新增待办事项',
    yesText:'增加',
    noText:'取消',
    addFunc:( values ) => addItemData('todoList', {...values,id:randomId()}),
    items:[
        {
            name:'title',
            label:'标题',
            rules:[
                {
                    required: true,
                    message: '标题为必填项!',
                },
            ]
        },
        {
            name:'content',
            label: '描述'
        }
    ],
    btnText:'+'
}

export const cardListSchema = {
    title:'新增常用标签',
    yesText:'添加',
    noText:'取消',
    addFunc:( values ) => addItemData('cardList', {...values,id:randomId()}),
    items:[
        {
            name:'title',
            label:'标签名',
            rules:[
                {
                    required: true,
                    message: '标签名为必填项!',
                },
            ]
        },
        {
            name:'url',
            label: 'Url路径',
            rules:[
                {
                    required: true,
                    message: 'Url路径为必填项!',
                },
            ]
        },
        {
            name:'content',
            label: '简述'
        }
    ],
    btnText:'+',
    btnSize:'middle'
}
